
#ifndef PHP_YSIP_H
#define PHP_YSIP_H

extern zend_module_entry ysip_module_entry;
#define phpext_ysip_ptr &ysip_module_entry

#ifdef PHP_WIN32
#define PHP_YSIP_API __declspec(dllexport)
#else
#define PHP_YSIP_API
#endif

#ifdef ZTS
#include "TSRM.h"
#endif

PHP_MINIT_FUNCTION(ysip);
PHP_MSHUTDOWN_FUNCTION(ysip);
PHP_RINIT_FUNCTION(ysip);
PHP_RSHUTDOWN_FUNCTION(ysip);
PHP_MINFO_FUNCTION(ysip);

PHP_FUNCTION(confirm_ysip_compiled);	/* For testing, remove later. */
PHP_FUNCTION(ysip_get_ip_info);
PHP_FUNCTION(ysip_get_region_info_by_name);
PHP_FUNCTION(ysip_get_region_info_by_name_ex);
PHP_FUNCTION(ysip_get_region_info_by_en_name);
PHP_FUNCTION(ysip_get_region_info);
PHP_FUNCTION(ysip_get_region_parents);
PHP_FUNCTION(ysip_get_region_childs);
PHP_FUNCTION(ysip_get_all_regions);
// compat for old version
PHP_FUNCTION(ysip_get_ipinfo);
PHP_FUNCTION(strtopinyin);

/* 
  	Declare any global variables you may need between the BEGIN
	and END macros here:     

ZEND_BEGIN_MODULE_GLOBALS(ysip)
	long  global_value;
	char *global_string;
ZEND_END_MODULE_GLOBALS(ysip)
*/

/* In every utility function you add that needs to use variables 
   in php_ysip_globals, call TSRMLS_FETCH(); after declaring other 
   variables used by that function, or better yet, pass in TSRMLS_CC
   after the last function argument and declare your utility function
   with TSRMLS_DC after the last declared argument.  Always refer to
   the globals in your function as YSIP_G(variable).  You are 
   encouraged to rename these macros something shorter, see
   examples in any other php module directory.
*/

#ifdef ZTS
#define YSIP_G(v) TSRMG(ysip_globals_id, zend_ysip_globals *, v)
#else
#define YSIP_G(v) (ysip_globals.v)
#endif

#endif	/* PHP_YSIP_H */

